<script type="text/javascript" language="javascript">
$(document).ready(function(){
	function getFileExtention(filename)
	{
	return filename.split('.').pop();
	}
	$("input[name='hlogo']").change(
	function(){
	if (getFileExtention($(this).val()).match(/jpg|jpeg|gif|png/i)==null)
	{
	alert("اللوجو يجب ان يكون صورة");
	$(this).val("");
	}
	}
	);
});
</script>
						<div class="">
                        <h1 class="right">إدارة المستخدمين</h1>
<a href="#add_client" class="add_client_pop">
<img src="images/add-icon.png" align="left" class="left" alt=""/>
</a>
         <div class="clear"></div>              
                       <div id="add_client" class="zoom-anim-dialog mfp-hide max-width800">
                     <?php require_once("userManag/Create.php"); ?>
                     </div>

                        <hr />
                        <div class="bookings-edit-container">
                        <p class="small text-right"></p>
                        
                        <table style="font-size:10px !important;border:1px solid #999 !important;" class="edit-bookings-table">
                            	<tr class="bg-head">
                                    <td style="padding:5px;" class="medium">أسم المستخدم</td>
                                    <td class="medium">نوع المستخدم</td>
                                  <!--  <td class="medium"></td> -->
                                    <td class="medium">العمليات</td>
                                </tr>
                                <?php 
								if(!empty($users)){
								$seen=array();
                                  foreach($users as $user){
								  if (isset($seen[$user['user_id']]))
								  {
								  continue;
								  }
								  $seen[$user['user_id']]=1;
								  if ($_SESSION["id"]!=$user['user_id'])
								  {
                                ?>
                                <tr>
                                    <td style="padding:5px;" class=""><?php echo $user['username']; ?></td>
                                    <td class=""><?php echo $user['name']; ?></td>
									
									 
                                    <td >
                                      <a href="#viewUser<?php echo $user['user_id']; ?>" class="view_furnitures_pop"><img src="images/view.png" class="" align="" alt="View"/></a>
									  <!--view popup  -->
									  <div id="viewUser<?php echo $user['user_id']; ?>" class="view_client zoom-anim-dialog mfp-hide view-booking-popup">
                                                   <?php require("userManag/view.php"); ?>
				                       </div>	
									  <span>|</span>
									   
                                      <a id="" href="edit-pop-ups/user.php?id=<?php echo $user['user_id']; ?>" class="ajax-pop-ups-magnific-no-modal"><img src="images/edit.png" class="margin-right5" align="" alt="Edit"/></a>
                                      									  <span>|</span>

									  <a href="#" style="color:red;" class="delete" >حذف</a>
									  <span>|</span>
									  <?php
									  if ($_SESSION['r']==0)
									  {
									  ?>
                                      <a href="./loginas.php?id=<?php echo $user['user_id']; ?>" style="color:red;" >تسجيل الدخول</a>
									  <?php
									  }
									  ?>
                                      <input class="delete-id" type="hidden" value="<?php echo $user['user_id']; ?>"/>
                                      <input  type="hidden" class = "other-id" value=""/>
									  <input type="hidden" class="rtype" value="<?php echo $user['id']; ?>" >
                                      <input class="filter-id" type="hidden" value="12"/> <!-- 12 means delete user -->
                                    </td>
									
                                </tr>
                               <?php 
							   }
							   }
							   }else{
				 echo "<td colspan='7' class='large red' align=''>لا توجد نتائج</td>";
				 }
				?> 
                         </table>
                        </div><br /></div>


						 

 